Skip to content

ci: validate docs on PR and only deploy Pages on release#570

Merged
adrianhall merged 2 commits into
CommunityToolkit:mainfrom
adrianhall:issues/562
Jul 11, 2026
Merged

ci: validate docs on PR and only deploy Pages on release#570
adrianhall merged 2 commits into
CommunityToolkit:mainfrom
adrianhall:issues/562

Conversation

@adrianhall

Copy link
Copy Markdown
Collaborator

Closes #562

Summary

build-docs.yml had no PR validation and republished the live GitHub Pages
site on every merge to main, per #562.

  • Add a pull_request trigger (and keep push: main, for parity) that runs
    a new validate job:
    • mkdocs build --strict -f ./mkdocs.production.yml to catch broken
      internal links/anchors/nav entries.
    • lycheeverse/lychee-action
      to catch dead external links in docs/**/*.md.
    • Never deploys.
  • Gate the deploy job to release: published (or a manual
    workflow_dispatch against a release tag), matching the
    build-library.yml/build-template.yml convention, instead of deploying
    on every push to main.
  • --strict is only used in the new CI-only validate job — not baked into
    mkdocs.production.yml or used by the build job that feeds deploy — so
    a stray warning can never block the artifact that actually gets published.
  • Move the Pages-specific permissions (pages: write, id-token: write),
    the pages concurrency group, and the configure-pages step down to the
    deploy job only, so PR/push validation runs stay fork-PR-safe and don't
    need elevated Pages permissions.
  • Fix every broken link/anchor the new checks surfaced:
    • A stale self-referential anchor link to a since-renamed doc page.
    • Two dead links to a GitHub user profile that no longer exists (kept the
      attribution text, dropped the dead hyperlink).
    • A doc link to a test-infra file (tests/infra/databases/cosmos.bicep)
      that no longer exists; repointed to the equivalent bicep module in the
      Cosmos DB sample.
    • A doc link to a MySQL test context class that no longer exists (removed;
      the page already notes MySQL is no longer tested as of v10.0.0).
    • A moved "Azure Cosmos DB for MongoDB (vCore)" Microsoft Learn URL.
    • An outdated Auth0 quickstart URL (old multi-page quickstart structure).
    • A URL with a missing / (learn.microsoft.comaspnet/...).

Verification

  • mkdocs build --strict -f ./mkdocs.production.yml — clean.
  • mkdocs build -f ./mkdocs.yml (local dev config, unaffected by the
    strict-mode change) — clean.
  • lychee against docs/**/*.md (with a browser-like user agent to avoid
    bot-blocking false positives on a couple of hosts) — 0 errors.
  • actionlint on .github/workflows/build-docs.yml — clean.
  • No src/**, tests/**, templates/**, or samples/** paths changed, so
    none of build-library.yml/build-template.yml/build-samples.yml
    apply. build-docs.yml itself was intentionally not dispatched on the
    fork ahead of this PR, since its current deploy job is unguarded — the
    fix will get its first live validation from this PR's own
    pull_request-triggered run.

ahall added 2 commits July 11, 2026 12:10
- build-docs.yml: add a pull_request trigger (and keep push to main, for
  parity) that runs a new 'validate' job — a strict mkdocs build to catch
  broken internal links/anchors/nav entries, plus lychee to catch dead
  external links. Never deploys.
- Gate the 'deploy' job to release: published (or a manual dispatch against
  a release tag), matching the build-library.yml/build-template.yml
  convention, instead of deploying on every push to main.
- Move the Pages-specific permissions/concurrency group and the
  configure-pages step to the 'deploy' job only, so PR/push validation runs
  are unaffected and don't need pages:write.
- Fix the broken links/anchors surfaced by the new checks: a stale
  self-referential anchor link, two dead GitHub file/profile links, a
  removed test-only MySQL doc link, a moved Azure Cosmos DB for MongoDB
  doc URL, an old Auth0 quickstart URL, and a URL missing a '/'.

Closes CommunityToolkit#562
… IPs)

The live pull_request run on PR CommunityToolkit#570 showed dotnet.microsoft.com returning
403 to the GitHub-hosted runner (same class of CDN/WAF bot-blocking as the
already-excluded dev.mysql.com and developers.facebook.com); the link is
live (302) from a normal client.
@adrianhall adrianhall merged commit b2eacd5 into CommunityToolkit:main Jul 11, 2026
5 checks passed
@adrianhall adrianhall deleted the issues/562 branch July 11, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: docs workflow has no PR validation and publishes to Pages on every merge to main

1 participant